<?php

namespace app\common\dao\user;

use app\common\model\user\UserFocus as model;
use app\common\dao\BaseDao;

class UserFocusDao extends BaseDao
{
    /**
    * 设置模型
    * @return model
    */
    protected function getModel(): string
    {
        return model::class;
    }


    public function search($where)
    {
        $query = $this->getModel()::getDB();
        $query->when(isset($where['uid']) && $where['uid'] !== '', function ($query)use($where){
            $query->where('uid',$where['uid']);
        })->when(isset($where['lawyer_id']) && $where['lawyer_id'] !== '', function ($query)use($where){
            $query->where('lawyer_id',$where['lawyer_id']);
        });

        return $query;
    }


}